package cn.edu.cug.cs.gtl.oi.ui.menu;

import javax.swing.*;
import java.awt.event.KeyEvent;

public class JMenuEntity extends JMenu{
    JMenu ItemCreateBody = new JMenu("创建体");
    JMenuItem ItemMouseCreatePyramid = new JMenuItem("鼠标创建棱锥");
    JMenuItem ItemMouseCreatePrism = new JMenuItem("鼠标创建棱柱");
    JMenuItem ItemMouseCreateEllipsoid = new JMenuItem("鼠标创建椭球体");
    JMenuItem ItemCloseSurfaceBody = new JMenuItem("封闭面成体");
    JMenuItem ItemTopBottomSurfaceBody = new JMenuItem("顶底面成体");
    JMenuItem ItemPolyhedronToCurveSurface = new JMenuItem("多面体->曲面");
    JMenuItem ItemCurveSurfaceToPolyhedron = new JMenuItem("曲面->多面体");
    JMenuItem ItemBodyMerge = new JMenuItem("多体之间合并");
    JMenuItem ItemExplodePolyhedron = new JMenuItem("炸开多面体");
    JMenuItem ItemNormalDirectionBody = new JMenuItem("按法线方向分解体");
    JMenuItem ItemElementExplode = new JMenuItem("图元爆炸");
    JMenuItem ItemCleanExplodeElement = new JMenuItem("清除爆炸图元");
    JMenu ItemBodyExceptionDetectAndDeal = new JMenu("体异常检测和处理");
    JMenuItem ItemCloseSurfaceBodyDetect = new JMenuItem("封闭面成体检测");
    JMenuItem ItemBodyObjEffectivenessTest = new JMenuItem("体对象有效性验证");
    JMenuItem ItemPolyhedronExceptionCheck = new JMenuItem("多面体异常检查");
    JMenuItem ItemMarkAbnormalPolyhedron = new JMenuItem("标识异常多面体(检查)");
    JMenuItem ItemExportPolyhedronGeometryInfo = new JMenuItem("导出多面体几何信息");
    JMenuItem ItemDecomposePolyhedronExceptionSurface = new JMenuItem("分解多面体异常面");
    JMenuItem ItemPolyhedronExceptionDeal = new JMenuItem("多面体异常处理");
    JMenuItem ItemAdjustBodyNormal = new JMenuItem("校正体法线");
    JMenuItem ItemRemoveBodyThicknessLocation = new JMenuItem("去除体厚度位置");

    public JMenuEntity() {
        this.setText("实体(H)");
        this.setMnemonic(KeyEvent.VK_H);
        init();
    }
    void init(){

        ItemCreateBody.add(ItemMouseCreatePyramid);

        ItemCreateBody.add(ItemMouseCreatePrism);
        ItemCreateBody.addSeparator();

        ItemCreateBody.add(ItemMouseCreateEllipsoid);

        this.add(ItemCreateBody);
        this.addSeparator();

        ItemCloseSurfaceBody.setEnabled(false);
        this.add(ItemCloseSurfaceBody);

        ItemTopBottomSurfaceBody.setEnabled(false);
        this.add(ItemTopBottomSurfaceBody);
        this.addSeparator();

        ItemPolyhedronToCurveSurface.setEnabled(false);
        this.add(ItemPolyhedronToCurveSurface);

        ItemCurveSurfaceToPolyhedron.setEnabled(false);
        this.add(ItemCurveSurfaceToPolyhedron);
        this.addSeparator();

        this.add(ItemBodyMerge);

        ItemExplodePolyhedron.setEnabled(false);
        this.add(ItemExplodePolyhedron);

        ItemNormalDirectionBody.setEnabled(false);
        this.add(ItemNormalDirectionBody);
        this.addSeparator();

        this.add(ItemElementExplode);

        this.add(ItemCleanExplodeElement);

        ItemCloseSurfaceBodyDetect.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemCloseSurfaceBodyDetect);

        ItemBodyExceptionDetectAndDeal.add(ItemBodyObjEffectivenessTest);
        ItemBodyExceptionDetectAndDeal.addSeparator();

        ItemPolyhedronExceptionCheck.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemPolyhedronExceptionCheck);

        ItemMarkAbnormalPolyhedron.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemMarkAbnormalPolyhedron);
        ItemBodyExceptionDetectAndDeal.addSeparator();

        ItemExportPolyhedronGeometryInfo.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemExportPolyhedronGeometryInfo);
        ItemBodyExceptionDetectAndDeal.addSeparator();

        ItemDecomposePolyhedronExceptionSurface.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemDecomposePolyhedronExceptionSurface);

        ItemPolyhedronExceptionDeal.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemPolyhedronExceptionDeal);

        ItemAdjustBodyNormal.setEnabled(false);
        ItemBodyExceptionDetectAndDeal.add(ItemAdjustBodyNormal);

        ItemBodyExceptionDetectAndDeal.add(ItemRemoveBodyThicknessLocation);

        this.add(ItemBodyExceptionDetectAndDeal);

        this.addSeparator();
    }
}
